Ubuntu 14.04
Sponsored Link

Limited shared directory
2014/04/26
 
Create a shared directory that requires user authentication.
[1] Configure Samba
root@smb:~#
groupadd security

root@smb:~#
mkdir /home/security

root@smb:~#
chgrp security /home/security

root@smb:~#
chmod 770 /home/security

root@smb:~#
vi /etc/samba/smb.conf
# line 60: comment out

#
map to guest = Bad User
# add at the last line

[Security]
# any name you like

   path = /home/security
   writable = yes
   create mode = 0770
   directory mode = 0770
   share modes = yes
   guest ok = no
# guest not allowed

   valid users = @security
# allow only security group
root@smb:~#
smbpasswd -a trusty
# add a user in Samba

New SMB password:
# set password

Retype new SMB password:
Added user trusty.
root@smb:~#
usermod -G security trusty

root@smb:~#
initctl restart smbd

smbd start/running, process 1017
[2] Configure on Windows client. This example is on Windows 7. Select [My Computer] - [Map Network Drive] like following example.
[3] Input '\\(server)\(shared directory)'
[4] Password is required. Input the one set in [1].
[5] Just accessed.
 
Tweet